import log from '@dfeidao/atom-nodejs/logger/log';
import { IncomingHttpHeaders } from 'http';
import { systemid,productid } from '../../atom/config';
import query from '@dfeidao/atom-nodejs/db/query';

interface Message {
	filter:{
		work_bill_no:string
	}
}


export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders){
	const { prepare, exec } = query(action_id,session_id,systemid);
	prepare('work_order', ['project_no','responsible_no','project_name','assetsname','start_time','place','working_hours','cust_name','contact_number','dyremindtime','work_order_status',
	'source_type','responsible','finish_time','timeout_period','cust_sat','responsible_no','customer_evaluation','work_order_type','customer_reviews','create_time','job_content',
	'completion_time','typename'], { productid,work_bill_no:message.filter.work_bill_no}, 1, 1, [], []);
	const [d1] = await exec();
	return{d1};
}
